/*    
 * Copyright (c) 2013 ISoftStone, Inc.
 * All right reserved.
 *
 * 文件名：      AccountBookServiceImpl.java
 * 作者:     Jacky Wang
 * 创建日期： 2013-7-30 下午04:16:47
 * 版本：           
 *
 */
package com.isoftstone.industry.aaa.core.service.assist.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.isoftstone.industry.persistance.bean.AccountBook;
import com.isoftstone.industry.aaa.core.dao.assist.AccountBookDao;
import com.isoftstone.industry.aaa.core.service.assist.IAccountBookService;
import com.isoftstone.modules.core.persistence.IGenericDao;
import com.isoftstone.modules.core.service.impl.GenericServiceImpl;

/**
 * @author jacky
 */
@Service
public class AccountBookServiceImpl extends GenericServiceImpl<AccountBook, String> implements IAccountBookService
{

	@Resource
	private AccountBookDao	acctBookDao;

	@Override
	public IGenericDao<AccountBook, String> getDao()
	{
		return acctBookDao;
	}

	@Override
	public AccountBook findCashAcctBook(String acctId)
	{
		return acctBookDao.findByTypeAndAccount(acctId, AccountBook.Types.CASH);
	}

	@Override
	public AccountBook findCreditAcctBook(String acctId)
	{
		return acctBookDao.findByTypeAndAccount(acctId, AccountBook.Types.CREDIT);
	}

	@Override
	public AccountBook findSpecialAcctBook(String acctId)
	{
		return acctBookDao.findByTypeAndAccount(acctId, AccountBook.Types.SPECIAL);
	}

}
